<template>
	<view style="background-color: aliceblue;height: 100vh;">
		<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#8cc540" ></uni-segmented-control>
		        <view class="content">
		            <view v-show="current === 0">
		                <Dh></Dh>
		            </view>
		            <view v-show="current === 1">
		                <Tabs></Tabs>
		            </view>
		        </view>
				<Alert v-if="alert" @close=close></Alert>
	</view>
</template>

<script setup>
	// import {uniSegmetndControl} from '@dcloudio/uni-ui'
	import {uniSegmetndControl} from '../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue'
	import Tabs from '@/pages/order/tabs.vue'
	import Dh from '@/pages/order/dh.vue'
	import Alert from '@/pages/order/alert.vue'
	import {ref} from 'vue'
	const items=ref(['当前订单', '历史订单'])
	const current=ref(0)
	const alert=ref(false)
	const onClickItem =(e)=> {
	      if (current.value != e.currentIndex) {
	              current.value = e.currentIndex;
	            }
		if(current.value===1){
			alert.value=true
		}
	    }
	const close=()=>{
		alert.value=false
	}
</script>

<style scoped>
	.content {
		width: 100%;
			/* #ifndef APP-NVUE */
			display: flex;
			/* #endif */
			justify-content: center;
			align-items: center;
			text-align: center;
		}
	
		
		.segmented-control__text.data-v-064e9cd1 {
			border-color: limegreen;
		}
		
		.data-v-064e9cd1{
			color:darkgray;
			
		}
</style>
